# 添加套件
import os
import unittest
# from HTMLTestRunner import HTMLTestRunner
from HTMLTestReportCN import HTMLTestRunner

from testcase.test_01 import Test_01

# 添加用例到套件
"""
# 方式1：
suite1 = unittest.TestSuite()
suite1.addTest(Test_01("test_02"))
suite1.addTest(Test_01("test_03"))
suite1.addTest(Test_01('test_01'))
# 方式2：
suite2 = unittest.TestSuite()
suite2.addTests([Test_01('test_01'), Test_01('test_01')])
# 方式3 直接添加一整个unittest类
suite3 = unittest.TestSuite()
suite3.addTests(unittest.TestLoader().loadTestsFromTestCase(Test_01))
# 方式4 通过类名添加
suite4 = unittest.TestSuite()
suite4.addTests(unittest.TestLoader().loadTestsFromName('test_01.TestCase'))
# 方式五：基于路径
case_dir = './'
suite5 = unittest.defaultTestLoader.discover(start_dir=case_dir, pattern='test_0*.py')

# 创建运行器,运行套件
runner = unittest.TextTestRunner()
runner.run(suite5)
"""

if __name__ == '__main__':
    pass
